import React, {Component} from "react";

class Button extends Component {
  render () {
    return (
      <div onClick={this.handleClick.bind(this)}>{this.props.text}</div>
    )
  }

  handleClick (e) {
    console.log(e.target);
    let text = this.props.text;
    console.log(`click button ${text}`);
    this.props.onClick(text);
  }
}

export default Button;